/*

 Copyright (c) 2008-2009 Fabrizio Pistonesi

 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

 */

#ifndef TRANSITION_H_
#define TRANSITION_H_

#include<irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

enum ETRANSITION_TYPE {ETT_FADE=0, ETT_WIPE=1, ETT_ROTATE=2};

class Transition
{
public:
	Transition(IrrlichtDevice* device);
	virtual ~Transition();

	void start(ETRANSITION_TYPE effect = ETT_FADE, int time = 500, float factor = 1);
	void draw();

	IrrlichtDevice* Device;
	IGUIImage* Fader;
	IGUIImage* FaderPrt;
	bool IsRunning;

	//Run() params
	ETRANSITION_TYPE Effect;
	int Time;
	float Factor;
	u32 StartTime,EndTime;
	ITexture* Tshot;
	dimension2d<s32> InitSize, EndSize, Size;
};

#endif /*TRANSITION_H_*/
